import WindowExtensionAbility from '@ohos.application.WindowExtensionAbility';

export default class WinsleiWindowExtensionAbility extends WindowExtensionAbility {
  onConnect(want) {
    console.info(`WindowExtAbility onConnect, abilityName: ${want.abilityName}`);
  }

  onDisconnect(want) {
    console.info(`WindowExtAbility onDisconnect, abilityName: ${want.abilityName}`);
  }

  onWindowReady(window) {
    console.info(`WindowExtAbility onWindowReady, window: ${JSON.stringify(window)}`);

    window.loadContent('pages/Index').then(() => {
      window.getProperties().then((pro) => {
        console.log('WindowExtension pro: ${JSON.stringify(pro)}');
      });
      window.show();
    });
  }
}
